Skip to content

Replace uses of fmt.Sprintf and fmt.Errorf with better alternatives#43413

Merged
chouetz merged 12 commits intomainfrom
lenaic/perfsprint
Nov 28, 2025
Merged

Replace uses of fmt.Sprintf and fmt.Errorf with better alternatives#43413
chouetz merged 12 commits intomainfrom
lenaic/perfsprint

Conversation

@L3n41c
Copy link
Copy Markdown
Member

@L3n41c L3n41c commented Nov 24, 2025

What does this PR do?

Enable the perfsprint linter that:

replaces uses of fmt.Sprintf and fmt.Errorf with better (both in CPU and memory) alternatives.

and also address all the suggested changes.

Motivation

Inefficient strings manipulations are currently common.
But when they happen in a hot path, the performance impact can be measurable as demonstrated in #43407.
For better code consistency, let’s apply the efficient patterns everywhere.

Describe how you validated your changes

No functional or behavioral change is expected. The new code should behave exactly like the old one.
The changes are very mechanical. They have all been generated by tools like perfsprint and goimports.
So, we can rely on existing unit and e2e tests run by the CI.

Additional Notes

Micro-benchmark:

package main

import (
	"flag"
        "fmt"
	"os"
        "strings"
        "testing"

        "github.com/stretchr/testify/assert"
)

var (
        key string
        value string
	expected string
)

func TestMain(m *testing.M) {
	flag.StringVar(&key, "key", "key", "key")
	flag.StringVar(&value, "value", "value", "value")
	flag.Parse()
	expected = key + ":" + value
	os.Exit(m.Run())
}

func BenchmarkSprintf(b *testing.B) {
        var tag string

        for b.Loop() {
                tag = fmt.Sprintf("%s:%s", key, value)
        }

        assert.Equal(b, expected, tag)
}

func BenchmarkConcat(b *testing.B) {
        var tag string

        for b.Loop() {
                tag = key + ":" + value
        }

        assert.Equal(b, expected, tag)
}

func BenchmarkStringBuffer(b *testing.B) {
        var tag strings.Builder

        for b.Loop() {
                tag.Reset()
                tag.Grow(len(key)+1+len(value))
                tag.WriteString(key)
                tag.WriteString(":")
                tag.WriteString(value)
        }

        assert.Equal(b, expected, tag.String())
}
$ go test -bench . -count=10 -args -key foo -value bar | ~/go/bin/benchstat -
goos: linux
goarch: amd64
pkg: benchmark
cpu: 12th Gen Intel(R) Core(TM) i9-12900H
                │      -       │
                │    sec/op    │
Sprintf-20        86.23n ±  5%
Concat-20         20.72n ± 15%
StringBuffer-20   24.38n ± 25%
geomean           35.19n
package main

import (
	"errors"
        "fmt"
        "testing"

        "github.com/stretchr/testify/assert"
)

func BenchmarkFmtErrorf(b *testing.B) {
        var err error

        for b.Loop() {
                err = fmt.Errorf("Boom!")
        }

        assert.EqualError(b, err, "Boom!")
}

func BenchmarkErrorsNew(b *testing.B) {
        var err error

        for b.Loop() {
                err = errors.New("Boom!")
        }

        assert.EqualError(b, err, "Boom!")
}
$ go test -bench . -count=10 | ~/go/bin/benchstat -
goos: linux
goarch: amd64
pkg: benchmark
cpu: 12th Gen Intel(R) Core(TM) i9-12900H
             │      -      │
             │   sec/op    │
FmtErrorf-20   52.44n ± 2%
ErrorsNew-20   15.37n ± 2%
geomean        28.39n

Real-case benchmark: see #43407.

Asked by the community: #38136.

Profiles comparison between the last nightly version that didn’t have this PR and the first nightly version that has it:
image

@L3n41c L3n41c added this to the 7.74.0 milestone Nov 24, 2025
@L3n41c L3n41c added [deprecated] team/containers changelog/no-changelog No changelog entry needed qa/done QA done before merge and regressions are covered by tests labels Nov 24, 2025
@github-actions github-actions bot added the short review PR is simple enough to be reviewed quickly label Nov 24, 2025
@agent-platform-auto-pr
Copy link
Copy Markdown
Contributor

agent-platform-auto-pr bot commented Nov 24, 2025

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 0711169

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${+0.05}$$ $${705.26}$$ < $${717.44}$$ $${+0.05}$$ $${172.86}$$ < $${177.37}$$
agent_deb_amd64_fips $${+0.06}$$ $${700.26}$$ < $${711.66}$$ $${-0.01}$$ $${171.78}$$ < $${174.84}$$
agent_heroku_amd64 $${+0.01}$$ $${326.75}$$ < $${337.57}$$ $${+0}$$ $${87.25}$$ < $${90.78}$$
agent_msi $${+0.14}$$ $${981.1}$$ < $${1015.38}$$ $${-0}$$ $${142.04}$$ < $${149.42}$$
agent_rpm_amd64 $${+0.05}$$ $${705.24}$$ < $${717.41}$$ $${+0.02}$$ $${175.94}$$ < $${178.01}$$
agent_rpm_amd64_fips $${+0.06}$$ $${700.25}$$ < $${711.64}$$ $${+0.02}$$ $${174.02}$$ < $${177.26}$$
agent_rpm_arm64 $${+0.11}$$ $${690.7}$$ < $${702.19}$$ $${+0.05}$$ $${159.77}$$ < $${163.22}$$
agent_rpm_arm64_fips $${+0.05}$$ $${686.64}$$ < $${697.6}$$ $${+0.03}$$ $${159.16}$$ < $${162.68}$$
agent_suse_amd64 $${+0.05}$$ $${705.24}$$ < $${717.41}$$ $${+0.02}$$ $${175.94}$$ < $${178.01}$$
agent_suse_amd64_fips $${+0.06}$$ $${700.25}$$ < $${711.64}$$ $${+0.02}$$ $${174.02}$$ < $${177.26}$$
agent_suse_arm64 $${+0.11}$$ $${690.7}$$ < $${702.19}$$ $${+0.05}$$ $${159.77}$$ < $${163.22}$$
agent_suse_arm64_fips $${+0.05}$$ $${686.64}$$ < $${697.6}$$ $${+0.03}$$ $${159.16}$$ < $${162.68}$$
docker_agent_amd64 $${+0.05}$$ $${767.6}$$ < $${769.92}$$ $${+0.03}$$ $${260.69}$$ < $${261.52}$$
docker_agent_arm64 $${+0.04}$$ $${777.32}$$ < $${779.46}$$ $${+0.04}$$ $${250.89}$$ < $${251.72}$$
docker_agent_jmx_amd64 $${+0.05}$$ $${958.47}$$ < $${960.8}$$ $${+0.03}$$ $${329.32}$$ < $${330.15}$$
docker_agent_jmx_arm64 $${+0.04}$$ $${956.92}$$ < $${958.93}$$ $${+0.03}$$ $${315.5}$$ < $${316.35}$$
docker_cluster_agent_amd64 $${+0.02}$$ $${178.34}$$ < $${207.49}$$ $${+0.01}$$ $${63.01}$$ < $${70.2}$$
docker_cluster_agent_arm64 $${+0}$$ $${195.83}$$ < $${223.38}$$ $${+0.02}$$ $${59.75}$$ < $${66.42}$$
docker_cws_instrumentation_amd64 $${-0}$$ $${7.07}$$ < $${7.12}$$ $${-0}$$ $${2.95}$$ < $${3.29}$$
docker_cws_instrumentation_arm64 $${0}$$ $${6.69}$$ < $${6.92}$$ $${-0}$$ $${2.7}$$ < $${3.07}$$
docker_dogstatsd_amd64 $${+0}$$ $${38.57}$$ < $${39.3}$$ $${+0}$$ $${14.91}$$ < $${15.76}$$
docker_dogstatsd_arm64 $${+0}$$ $${37.24}$$ < $${37.94}$$ $${-0}$$ $${14.35}$$ < $${14.83}$$
dogstatsd_deb_amd64 $${+0}$$ $${29.8}$$ < $${30.53}$$ $${+0}$$ $${7.86}$$ < $${8.75}$$
dogstatsd_deb_arm64 $${+0}$$ $${28.31}$$ < $${29.11}$$ $${+0}$$ $${6.8}$$ < $${7.71}$$
dogstatsd_rpm_amd64 $${+0}$$ $${29.8}$$ < $${30.53}$$ $${+0}$$ $${7.87}$$ < $${8.76}$$
dogstatsd_suse_amd64 $${+0}$$ $${29.8}$$ < $${30.53}$$ $${+0}$$ $${7.87}$$ < $${8.76}$$
iot_agent_deb_amd64 $${+0.01}$$ $${42.55}$$ < $${43.19}$$ $${+0}$$ $${11.11}$$ < $${11.98}$$
iot_agent_deb_arm64 $${+0.01}$$ $${40.29}$$ < $${40.92}$$ $${+0}$$ $${9.57}$$ < $${10.45}$$
iot_agent_deb_armhf $${+0}$$ $${40.19}$$ < $${40.86}$$ $${+0}$$ $${9.68}$$ < $${10.56}$$
iot_agent_rpm_amd64 $${+0.01}$$ $${42.55}$$ < $${43.19}$$ $${+0.01}$$ $${11.13}$$ < $${12.0}$$
iot_agent_suse_amd64 $${+0.01}$$ $${42.55}$$ < $${43.19}$$ $${+0.01}$$ $${11.13}$$ < $${12.0}$$

@cit-pr-commenter
Copy link
Copy Markdown

cit-pr-commenter bot commented Nov 24, 2025

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: bcffefba-11dd-4f9f-8216-ce150e1feda4

Baseline: e558d85
Comparison: b0faba9
Diff

Optimization Goals: ✅ No significant changes detected

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization +5.08 [+2.07, +8.10] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization +5.08 [+2.07, +8.10] 1 Logs
quality_gate_metrics_logs memory utilization +0.88 [+0.66, +1.10] 1 Logs bounds checks dashboard
otlp_ingest_metrics memory utilization +0.37 [+0.22, +0.51] 1 Logs
otlp_ingest_logs memory utilization +0.32 [+0.23, +0.42] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.13 [+0.05, +0.20] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.11 [-0.29, +0.51] 1 Logs
file_tree memory utilization +0.09 [+0.04, +0.14] 1 Logs
ddot_metrics_sum_cumulative memory utilization +0.07 [-0.07, +0.22] 1 Logs
uds_dogstatsd_to_api ingress throughput +0.02 [-0.11, +0.15] 1 Logs
uds_dogstatsd_to_api_v3 ingress throughput +0.01 [-0.13, +0.14] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.07, +0.07] 1 Logs
file_to_blackhole_1000ms_latency egress throughput -0.01 [-0.42, +0.41] 1 Logs
quality_gate_idle_all_features memory utilization -0.01 [-0.06, +0.04] 1 Logs bounds checks dashboard
file_to_blackhole_500ms_latency egress throughput -0.02 [-0.39, +0.36] 1 Logs
file_to_blackhole_100ms_latency egress throughput -0.04 [-0.09, +0.01] 1 Logs
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization -0.06 [-0.11, -0.01] 1 Logs
ddot_metrics memory utilization -0.12 [-0.33, +0.10] 1 Logs
quality_gate_idle memory utilization -0.12 [-0.17, -0.07] 1 Logs bounds checks dashboard
ddot_logs memory utilization -0.25 [-0.33, -0.18] 1 Logs
ddot_metrics_sum_cumulativetodelta_exporter memory utilization -0.47 [-0.70, -0.23] 1 Logs
docker_containers_memory memory utilization -0.77 [-0.85, -0.68] 1 Logs
ddot_metrics_sum_delta memory utilization -0.83 [-1.03, -0.63] 1 Logs
quality_gate_logs % cpu utilization -1.89 [-3.32, -0.45] 1 Logs bounds checks dashboard

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
docker_containers_cpu simple_check_run 10/10
docker_containers_memory memory_usage 10/10
docker_containers_memory simple_check_run 10/10
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency lost_bytes 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_logs memory_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs intake_connections 10/10 bounds checks dashboard
quality_gate_metrics_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_metrics_logs memory_usage 10/10 bounds checks dashboard

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.

@github-actions github-actions bot added component/system-probe long review PR is complex, plan time to review it and removed short review PR is simple enough to be reviewed quickly labels Nov 24, 2025
@github-actions github-actions bot added short review PR is simple enough to be reviewed quickly component/system-probe long review PR is complex, plan time to review it and removed component/system-probe long review PR is complex, plan time to review it short review PR is simple enough to be reviewed quickly labels Nov 24, 2025
@L3n41c
Copy link
Copy Markdown
Member Author

L3n41c commented Nov 24, 2025

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@L3n41c L3n41c force-pushed the lenaic/perfsprint branch 2 times, most recently from 2152ad2 to 841e7d6 Compare November 24, 2025 21:23
@github-actions github-actions bot added short review PR is simple enough to be reviewed quickly and removed component/system-probe long review PR is complex, plan time to review it labels Nov 24, 2025
@github-actions github-actions bot removed the short review PR is simple enough to be reviewed quickly label Nov 25, 2025
@dd-devflow-routing-codex
Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-11-28 06:41:47 UTC ℹ️ Start processing command /trigger-ci
If you need support, contact us on Slack #devflow!


2025-11-28 06:44:51 UTC 🚨 Devflow

Post "https://gitlab.ddbuild.io/api/v4/projects/DataDog%2Fdatadog-agent/pipeline": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Details
child workflow execution error (type: devtools.Devtools_TriggerCiFromPr, workflowID: 7e3dda75-8bc5-467f-9456-a7fa1d18eb7c_36, runID: 8b637654-8771-4555-b3ee-87174159c2a9, initiatedEventID: 36, startedEventID: 37): child workflow execution error (type: devtools.Devtools_TriggerCi, workflowID: 8b637654-8771-4555-b3ee-87174159c2a9_14, runID: 0883ba16-0f58-4d5b-a4d3-cd13e91fc94a, initiatedEventID: 14, startedEventID: 15): activity error (type: gitlab.GitlabService_CreatePipeline, scheduledEventID: 26, startedEventID: 27, identity: ): activity ScheduleToClose timeout (type: ScheduleToClose): Post "https://gitlab.ddbuild.io/api/v4/projects/DataDog%2Fdatadog-agent/pipeline": context deadline exceeded (Client.Timeout exceeded while awaiting headers) (type: Error, retryable: true): context deadline exceeded (Client.Timeout exceeded while awaiting headers) (type: timeoutError, retryable: true)

If you need support, contact us on Slack #devflow with those details!

@L3n41c
Copy link
Copy Markdown
Member Author

L3n41c commented Nov 28, 2025

/trigger-ci

@dd-devflow-routing-codex
Copy link
Copy Markdown

dd-devflow-routing-codex bot commented Nov 28, 2025

View all feedbacks in Devflow UI.

2025-11-28 07:58:29 UTC ℹ️ Start processing command /trigger-ci


2025-11-28 07:59:30 UTC ℹ️ Gitlab pipeline started

Started pipeline #84318398

Copy link
Copy Markdown
Member

@pgimalac pgimalac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for Agent Runtimes and e2e testing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the linter be disabled on test files ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, readability is decreased with string concatenation compared to fmt.Sprintf, and performance should not really be a concern on test files/assertions ?

Copy link
Copy Markdown
Member Author

@L3n41c L3n41c Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question for the test package

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@lavigne958 lavigne958 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the large number of changes in this pull request, only one file is being shown at a time.

Apparently Github has recently learnt something, probably due to: #43238 😆

LGTM !

@pgimalac
Copy link
Copy Markdown
Member

You need to switch back to the "old experience" to view all files 🙃

Copy link
Copy Markdown
Contributor

@RomainMuller RomainMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (for @DataDog/asm-go) thank you!

Copy link
Copy Markdown
Contributor

@anais-raison anais-raison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for @DataDog/agent-apm !

Copy link
Copy Markdown
Contributor

@adel121 adel121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for @DataDog/container-platform

Copy link
Copy Markdown
Contributor

@BaptisteFoy BaptisteFoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm for fleet

@AlexanderYastrebov
Copy link
Copy Markdown
Contributor

BenchmarkConcat likely suffers from constant folding, 1ns runtime is unrealistic and should rather be close to strings.Builder. Here is another variant using non-constant key/value:

package main

import (
	"fmt"
	"os"
	"strings"
	"testing"
)

var (
	key      = os.Args[0]
	value    = os.Args[0]
	expected = key + ":" + value
)

func BenchmarkSprintf(b *testing.B) {
	var tag string

	for b.Loop() {
		tag = fmt.Sprintf("%s:%s", key, value)
	}

	if tag != expected {
		b.Fatal()
	}
}

func BenchmarkConcat(b *testing.B) {
	var tag string

	for b.Loop() {
		tag = key + ":" + value
	}

	if tag != expected {
		b.Fatal()
	}
}

func BenchmarkStringBuilder(b *testing.B) {
	var tag strings.Builder

	for b.Loop() {
		tag.Reset()
		tag.Grow(len(key) + 1 + len(value))
		tag.WriteString(key)
		tag.WriteString(":")
		tag.WriteString(value)
	}

	if tag.String() != expected {
		b.Fatal()
	}
}
% go test -bench=. -count=10 | benchstat -         
goos: darwin
goarch: arm64
cpu: Apple M4 Max
                 │      -      │
                 │   sec/op    │
Sprintf-16         66.27n ± 3%
Concat-16          26.36n ± 2%
StringBuilder-16   28.79n ± 6%
geomean            36.91n

Internally concatenation uses runtime function concat3 which uses copy and strings.Builder uses WriteString which uses append:

% go test -c
% go tool objdump -s BenchmarkConcat benchconcat.test | grep CALL
  main_test.go:32       0x10010c850             97fd3360                CALL runtime.concatstring3(SB)
  benchmark.go:514      0x10010c884             97feed0b                CALL testing.(*B).loopSlowPath(SB)
  main_test.go:35       0x10010c8bc             97fbd565                CALL runtime.memequal(SB)
  main_test.go:36       0x10010c8d4             97ff12a3                CALL testing.(*common).Fatal(SB)
  main_test.go:28       0x10010c8ec             97fda7ed                CALL runtime.morestack_noctxt.abi0(SB)
% go tool objdump -s BenchmarkStringBuilder benchconcat.test | grep CALL
  main_test.go:44       0x10010c92c             97feb891                CALL strings.(*Builder).Reset(SB)
  main_test.go:45       0x10010c94c             97feb8d1                CALL strings.(*Builder).Grow(SB)
  main_test.go:46       0x10010c960             97feb998                CALL strings.(*Builder).WriteString(SB)
  main_test.go:47       0x10010c974             97feb993                CALL strings.(*Builder).WriteString(SB)
  main_test.go:48       0x10010c988             97feb98e                CALL strings.(*Builder).WriteString(SB)
  benchmark.go:514      0x10010c9b0             97feecc0                CALL testing.(*B).loopSlowPath(SB)
  main_test.go:51       0x10010c9ec             97fbd519                CALL runtime.memequal(SB)
  main_test.go:52       0x10010ca04             97ff1257                CALL testing.(*common).Fatal(SB)
  builder.go:47         0x10010ca18             97fd7eae                CALL runtime.panicunsafestringlen(SB)
  builder.go:47         0x10010ca1c             97fd7ebd                CALL runtime.panicunsafestringnilptr(SB)
  main_test.go:40       0x10010ca2c             97fda79d                CALL runtime.morestack_noctxt.abi0(SB)

see https://go.dev/src/runtime/string.go and https://go.dev/src/strings/builder.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ask-review Ask required teams to review this PR changelog/no-changelog No changelog entry needed component/system-probe [deprecated] team/containers long review PR is complex, plan time to review it qa/done QA done before merge and regressions are covered by tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.